<h1 class="page-header">
    <small>会员管理</small>
</h1>
<hr/>
<div class="panel panel-inverse" data-sortable-id="form-stuff-5">
    <div class="panel-heading">
        <h4 class="panel-title">会员查询</h4>
    </div>
    <div class="panel-body">
        <form id="memberForm" name="memberForm" method="post" class="form-inline">
            <div class="form-group m-r-10">
                <input type="text" class="form-control" name="EQ_id" value="${EQ_id}" placeholder="会员ID">
            </div>
            <div class="form-group m-r-10">
                <input type="text" class="form-control" name="LIKE_name" value="${LIKE_name}" placeholder="会员姓名">
            </div>
            <div class="form-group m-r-10">
                <input type="text" class="form-control" name="LIKE_mobile" value="${LIKE_mobile}" placeholder="手机号码">
            </div>
            <div class="form-group m-r-10">
                <input type="text" class="form-control" name="LIKE_birthday" value="${LIKE_birthday}" placeholder="生日">
            </div>
            <div class="form-group m-r-10">
                <select class="form-control" name="EQ_status" id="EQ_status">
                    <option value="">状态</option>
                    <option value="A" <#if params.EQ_status== 'A'>selected</#if>>激活</option>
                    <option value="D" <#if params.EQ_status== 'D'>selected</#if>>禁用</option>
                </select>
            </div>
            <button type="button" class="btn btn-sm btn-success" onclick="postDataByForm('backend/member/queryList','displayArea','memberForm')"><i class="fa fa-search"></i>查询</button>
            <button type="button" class="btn btn-sm btn-danger" onclick="getData('${rc.contextPath}/backend/member/add','displayArea')"><i class="fa fa-plus"></i>新增会员</button>
            <button type="button" class="btn btn-sm btn-success" onclick="getData('${rc.contextPath}/backend/member/import','displayArea')"><i class="fa fa-sign-in"></i>Excel导入会员</button>
        </form>
    </div>
</div>
<hr/>
<div class="panel panel-inverse" data-sortable-id="table-basic-4">
    <div class="panel-heading">
        <h4 class="panel-title">会员列表</h4>
    </div>
    <div class="panel-body">
        <table class="table table-striped table-bordered">
            <thead>
            <tr>
                <th>头像</th>
                <th>等级</th>
                <th>手机号</th>
                <th>姓名</th>
                <th>生日</th>
                <th>余额</th>
                <th>积分</th>
                <th>状态</th>
                <th>创建时间</th>
                <th>活跃时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <#if paginationResponse?has_content && paginationResponse.content?exists && paginationResponse.content?size gt 0>
                <#list paginationResponse.content as ct>
                    <tr>
                        <td><img class="avatar" src="<#if (ct.avatar)>${ct.avatar}<#else>${rc.contextPath}/static/defaultImage/avatar.png</#if>"/></td>
                        <td>
                            <#list userGradeMap as grade>
                            <#if grade.id == ct.gradeId >
                            ${grade.name}
                            </#if>
                            </#list>
                        </td>
                        <td><#if (ct.mobile)>${ct.mobile}<#else>-</#if></td>
                        <td>${ct.name}</td>
                        <td><#if (ct.birthday)>${ct.birthday}<#else>-</#if></td>
                        <td><#if (ct.balance > 0)>${ct.balance}<#else>0.0</#if></td>
                        <td><#if (ct.point)>${ct.point}<#else>0</#if></td>
                        <td>
                        <#if ct.status == "A">
                            激活
                        <#else>
                            禁用
                        </#if>
                        </td>
                        <td>${ct.createTime}</td>
                        <td>${ct.updateTime}</td>
                        <td>
                            <a class="label label-success small-btn" href="javascript:getData('${rc.contextPath}/backend/member/memberEditInit/${ct.id}','displayArea')"><i class="fa fa-edit"></i>编辑</a>
                            <#if ct.status == "A">
                            <a class="label label-danger small-btn" href="javascript:getConfirmData('确定禁用该会员吗?','${rc.contextPath}/backend/member/delete/${ct.id}','displayArea')"><i class="fa fa-lock"></i>禁用</a>
                            </#if>
                        </td>
                    </tr>
                </#list>
            <#else>
            <tr class="gradeA even" role="row">
                <td colspan="12" class="text-center">没有符合条件的数据！</td>
            </tr>
            </#if>
        </table>
    </div>
</div>

<!-- 分页组件 -->
<!-- recordBean 分页查询结果Bean
     action 分页请求URL
     formName 分页需要的查询参数的表单名称 -->
<@sp.pagination recordBean=paginationResponse action="${rc.contextPath}/backend/member/queryList" formName="memberForm"/>